<!-- Generated automatically from an XML file of the same name.
     Copyright: Stephen J. Sangwine and Nicolas Le Bihan, 2008-2010.
--><html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>angle :: Functions (Quaternion Toolbox Function Reference)
</title><link rel="stylesheet" href="qtfmstyle.css" type="text/css"></head><body><h1>Quaternion Function Reference</h1><h2>angle</h2>
<p>Angle of a quaternion in polar form<br>(Quaternion overloading of standard MATLAB&reg; function)
</p>
<h2>Syntax</h2><p><tt>&#952; = angle(q, a)</tt></p>
<h2>Description</h2>
<p>
<tt>angle(X)</tt> computes the angle of a quaternion in polar form. The
polar form of a quaternion is q = A exp(&#956;&#952;) where A is a real or complex
modulus, &#956; is a unit pure quaternion, and &#952; is an angle. It is &#952; that is
computed by this function.
</p>
<p>
The second parameter is optional. If omitted, the result will always be
in the range (0, &#960;), that is, the quaternion q is regarded as being in
the upper half of a complex plane defined by the axis of q. A reference
unit vector defining the direction of the positive imaginary axis of q
may be supplied as the second parameter, in which case the result may
be in the full range from -&#960; to +&#960;. This reference unit vector is used
to define the north pole of a hemisphere of 3-space, so that if the axis
of q lies in this hemisphere, the angle is in the range (0,&#960;). If the
axis of q lies in the other (southern) hemisphere, then the angle
returned will lie in (&#960;, 2*&#960;).
</p>
<p>
The optional argument must be either the same size as q or be a scalar
(in which case the same value is used for all elements of q).
</p>

<h2>Examples</h2>
<pre>
&gt;&gt; angle(randq(2))

ans =

    1.8062    1.5062
    2.2535    1.9501
</pre>

<h2>See Also</h2>QTFM function: <a href="axis.html">axis</a><br>MATLAB&reg; function: <a href="matlab:doc angle">angle</a><br>
<h4>&copy; 2008-2010 Stephen J. Sangwine and Nicolas Le Bihan</h4><p><a href="license.html">License terms.</a></p></body></html>